

#ifndef ZGEOMENT_DBREGION_H
#define ZGEOMENT_DBREGION_H

#include "zdbmain.h"
#include "zdbsubeid.h"
#include "zgepnt3d.h"
#include "zgevec3d.h"

#pragma pack(push, 8)

class UcDbRegion: public  UcDbEntity
{
public:
    UcDbRegion();
    virtual ~UcDbRegion();
    UCDB_DECLARE_MEMBERS(UcDbRegion);

    static  
    Ucad::ErrorStatus createFromCurves(const UcDbVoidPtrArray& curveSegments, 
                                       UcDbVoidPtrArray& regions);

    virtual Ucad::ErrorStatus getPerimeter(double&) const;
    virtual Ucad::ErrorStatus getArea(double& regionArea) const;

	UCDB_PORT virtual void	  dragStatus(const UcDb::DragStat);
	virtual void*             ZSMBodyCopy(bool bDeepCopy = false) const; 
	virtual void const *      getLockedZSMBody();                        
	virtual void              unlockZSMBody();                           
	virtual void*             getLockedWritableZSMBody();                
	virtual void              commitWritableZSMBody();                   
	virtual Ucad::ErrorStatus setZSMBody(const void* modelerBody);       

    virtual Ucad::ErrorStatus getAreaProp(
                                 const UcGePoint3d&  origin,
                                 const UcGeVector3d& xAxis,
                                 const UcGeVector3d& yAxis,
                                 double&             perimeter,
                                 double&             area,
                                 UcGePoint2d&        centroid,
                                 double              momInertia[2],
                                 double&             prodInertia,
                                 double              prinMoments[2],
                                 UcGeVector2d        prinAxes[2],
                                 double              radiiGyration[2],
                                 UcGePoint2d&        extentsLow,
                                 UcGePoint2d&        extentsHigh)const;

    virtual Ucad::ErrorStatus getPlane(UcGePlane& regionPlane) const;

    virtual  Ucad::ErrorStatus intersectWith(const UcDbEntity* ent,
                                             UcDb::Intersect   intType,
                                             UcGePoint3dArray& points,
                                             ZSoft::GsMarker   thisGsMarker,
                                             ZSoft::GsMarker   otherGsMarker) const;
    virtual  Ucad::ErrorStatus intersectWith(const UcDbEntity* ent,
                                             UcDb::Intersect   intType,
                                             const UcGePlane&  projPlane,
                                             UcGePoint3dArray& points,
                                             ZSoft::GsMarker   thisGsMarker,
                                             ZSoft::GsMarker   otherGsMarker) const;

    virtual ZSoft::Boolean    isNull () const;
    virtual Ucad::ErrorStatus getNormal(UcGeVector3d&) const;

    virtual UcDbSubentId      internalSubentId      (void* ent) const;                
    virtual void*             internalSubentPtr     (const UcDbSubentId& id) const;

    virtual  Ucad::ErrorStatus getSubentPathsAtGsMarker(UcDb::SubentType     type,
                                                        ZSoft::GsMarker      gsMark,
                                                        const UcGePoint3d&   pickPoint,
                                                        const UcGeMatrix3d&  viewXform,
                                                        int&                 numPaths,
                                                        UcDbFullSubentPath*& subentPaths,
                                                        int                  numInserts = 0,
                                                        UcDbObjectId* entAndInsertStack = NULL) const;

    virtual Ucad::ErrorStatus getGsMarkersAtSubentPath(
                                 const UcDbFullSubentPath& subPath,
                                 UcArray<ZSoft::GsMarker>& gsMarkers) const;

    virtual UcDbEntity*       subentPtr(const UcDbFullSubentPath& id) const;
 
    virtual Ucad::ErrorStatus booleanOper(UcDb::BoolOperType operation, UcDbRegion* otherRegion);

    virtual ZSoft::UInt32 numChanges() const;

	UCDB_PORT virtual bool usesGraphicsCache();
    virtual Ucad::ErrorStatus getClassID(CLSID* pClsid) const;
};

#pragma pack(pop)

#endif
